<?php

namespace App\Http\Controllers\Web\Admin;

use App\Http\Controllers\Web\BaseController;
use Illuminate\Http\Request;
use JetBrains\PhpStorm\ArrayShape;
use function auth;

class UserController extends BaseController
{
    /**
     * @return mixed
     */
    public function index (): mixed
    {
        $user_info = auth()->user();
        return $this->success(data: $user_info);
    }

    public function getMenuList ()
    {
        $result = [
            [
                'path'      => '/dashboard',
                'name'      => 'Dashboard',
                'component' => 'LAYOUT',
                'redirect'  => '/dashboard/analysis',
                'meta'      => [
                    'title'              => 'routes.dashboard.dashboard',
                    'icon'               => 'bx:bx-home',
                ],
                'children'  => [
                    [
                        'path'      => 'analysis',
                        'name'      => 'Analysis',
                        'component' => '/dashboard/analysis/index',
                        'meta'      => [
                            'title'             => 'routes.dashboard.analysis',
                        ],
                    ],
                    [
                        'path'      => 'workbench',
                        'name'      => 'Workbench',
                        'component' => '/dashboard/workbench/index',
                        'meta'      => [
                            'title' => 'routes.dashboard.workbench',
                        ],
                    ],
                ],
            ],
            [
                'path'      => '/about',
                'name'      => 'About',
                'component' => 'LAYOUT',
                'redirect'  => '/about/about-page',
                'meta'      => [
                    'title'              => 'routes.dashboard.about',
                    'orderNo'            => 100000,
                    'icon'               => 'simple-icons:about-dot-me',
                ],
                'children'  => [
                    [
                        'path'      => 'about-page',
                        'name'      => 'AboutPage',
                        'component' => '/sys/about/index',
                        'meta'      => [
                            'title' => 'routes.dashboard.about',
                        ],
                    ],
                ],
            ],
        ];
        return $this->success(data: $result);
    }

    public function getPermCode ()
    {
        return $this->success(data: []);
    }
}
